package com.hello.system.domain;

import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.hello.common.core.annotation.Excel;
import com.hello.common.core.web.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 聊天会话对象 sd_chat_sessions
 * 
 * @author hello
 * @date 2025-05-15
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class ChatSessions extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 会话ID，使用UUID格式 */
    private String sessionId;

    /** 用户ID，关联系统用户表 */
    @Excel(name = "用户ID，关联系统用户表")
    private Long userId;

    /** 聊天伙伴描述（如AI助手等） */
    @Excel(name = "聊天伙伴描述", readConverterExp = "如=AI助手等")
    private String chatPartnerDescription;

    /** 话题ID */
    @Excel(name = "话题ID")
    private Long topicId;

    /** 会话状态，默认为活跃 */
    @Excel(name = "会话状态，默认为活跃")
    private String status;

    /** 开始时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date startedAt;

    /** 最后消息时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "最后消息时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date lastMessageAt;

    /** 结束时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date endedAt;

    public void setSessionId(String sessionId) 
    {
        this.sessionId = sessionId;
    }

    public String getSessionId() 
    {
        return sessionId;
    }
    public void setUserId(Long userId) 
    {
        this.userId = userId;
    }

    public Long getUserId() 
    {
        return userId;
    }
    public void setChatPartnerDescription(String chatPartnerDescription) 
    {
        this.chatPartnerDescription = chatPartnerDescription;
    }

    public String getChatPartnerDescription() 
    {
        return chatPartnerDescription;
    }
    public void setTopicId(Long topicId) 
    {
        this.topicId = topicId;
    }

    public Long getTopicId() 
    {
        return topicId;
    }
    public void setStatus(String status) 
    {
        this.status = status;
    }

    public String getStatus() 
    {
        return status;
    }
    public void setStartedAt(Date startedAt) 
    {
        this.startedAt = startedAt;
    }

    public Date getStartedAt() 
    {
        return startedAt;
    }
    public void setLastMessageAt(Date lastMessageAt) 
    {
        this.lastMessageAt = lastMessageAt;
    }

    public Date getLastMessageAt() 
    {
        return lastMessageAt;
    }
    public void setEndedAt(Date endedAt) 
    {
        this.endedAt = endedAt;
    }

    public Date getEndedAt() 
    {
        return endedAt;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("sessionId", getSessionId())
            .append("userId", getUserId())
            .append("chatPartnerDescription", getChatPartnerDescription())
            .append("topicId", getTopicId())
            .append("status", getStatus())
            .append("startedAt", getStartedAt())
            .append("lastMessageAt", getLastMessageAt())
            .append("endedAt", getEndedAt())
            .toString();
    }
}
